﻿using System.Collections.Generic;
using System.Windows.Controls;
using Kiva7.Controls;
using Kiva7.DataClasses;
using System.Collections.ObjectModel;

namespace Kiva7.Pages
{
    public partial class LendersControl : BaseUserControl
    {
        public LendersControl()
        {
            InitializeComponent();
        }

        private void lbxLenders_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Lender model = lbxLenders.SelectedItem as Lender;
            if (model == null)
            {
                return;
            }
            if (lbxLenders.ItemsSource is List<Lender>)
            {
                DoNavigate(LenderDetailPage.GetPageUrl(lbxLenders.ItemsSource as List<Lender>, lbxLenders.SelectedIndex));
            }
            lbxLenders.SelectedItem = null;
        }
    }
}
